<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>{$current['title']}-{$Think.CONFIG.title}</title>
    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <include file="Public/head" />
</head>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set" />
                <!-- /section:settings.box -->

                <div class="row">
                    <div class="page-content">
						<div class="page-content-area">
							<div class="row">
								<div class="col-xs-12">

									<style>
									#day_log_table{
										border: 1px solid #9ebbb8;
										border-top: 0;
										border-left: 0;
										width: 100%;
									}
									#day_log_table_f{
										border: 1px solid #9ebbb8;
										position: absolute;
										top: 0px;
										width: 98%;
										width: -webkit-calc(100% - 24px);
										width: -moz-calc(100% - 24px);
										width: calc(100% - 24px);
										background-color: #fff;
									}
									#day_log_table td,#day_log_table_f td{
										border: 1px solid #9ebbb8;
										border-bottom: 0;
										border-right: 0;
										width:13%;
									}
									#day_log_table td.td_c,#day_log_table_f td.td_c{
										line-height: 34px;
										text-align: center;
									}
									#day_log_table td.td_c,#day_log_table_f td.td_c:first-child{
										width:9%;
									}
									#day_log_table td span{
										line-height:40px;
										width: 100%;
										display: block;
										padding: 1% 2%;
									}
									#day_log_table td input{
										width: 50%;
										text-align: center;
										line-height: 25px;
									}


									.IP{
										background-color:#f3f1ee;
									}
									.zh_IP{
										background-color:#cfd5d6;
									}
									.Jump_ratio{
										background-color:#f3f1ee;
									}
									.zh_jz_IP{
										background-color:#cfd5d6;
									}
									.recharge_sum{
										background-color:#f3f1ee;
										color: #E91E63;
										font-weight: bold;
									}
									.recharge_jz_sum{
										background-color:#cfd5d6;
										color: #ff8f00;
										font-weight: bold;
									}
									.recharge_num{
										background-color:#f3f1ee;
									}
									.recharge_user{
										background-color:#cfd5d6;
									}
									.ratio{
										background-color:#f3f1ee;
										color:#1000ff;
										font-weight: bold;
									}
									.register_num{
										background-color:#cfd5d6;
									}

									.subscribe_num{
										background-color:#f3f1ee;
									}
									.r_s_ratio{
										background-color:#cfd5d6;
										color: #a42ad6;
										font-weight: bold;
									}
									.sum_xs_IP{
										background-color:#f3f1ee;
									}
									.sum_IP{
										background-color:#cfd5d6;
									}

									#day_log_table tr:last-child .recharge_sum,#day_log_table tr:last-child .ratio,#day_log_table tr:last-child .subscribe_num{
										background-color:#cfd5d6;
									}
									#day_log_table tr:last-child .register_num,#day_log_table tr:last-child .r_s_ratio{
										background-color:#f3f1ee;
									}
									</style>
									<table cellspacing="0" cellpadding="0" id="day_log_table">
									<volist name="data" id="vo">
									<tr>
										<volist name="vo" id="vo_v">
										<if condition="is_array($vo_v)">
										<td data-day="{$key}">
											<volist name="vo_v" id="value">
											<span class="{$key}">
											<if condition="$key eq 'register_num'">注册数
											<elseif condition="$key eq 'subscribe_num'" />关注数
											<elseif condition="$key eq 'first_charge_num'" />首充数
											<elseif condition="$key eq 'r_s_ratio'" />关注率
											<elseif condition="$key eq 'recharge_user'" />充值人数
											<elseif condition="$key eq 'recharge_num'" />订单数
											<elseif condition="$key eq 'recharge_sum'" />充值金额
											<elseif condition="$key eq 'zh_IP' or $key eq 'sum_IP'" />CPS IP数
											<elseif condition="$key eq 'zh_jz_IP'" />CPS 总IP数
											<elseif condition="$key eq 'recharge_jz_sum'" />充值总金额
											<elseif condition="$key eq 'IP'" />小说IP数
											<elseif condition="$key eq 'ratio'" />转化率
											<elseif condition="$key eq 'Jump_ratio'" />IP注册率
											<elseif condition="$key eq 'sum_xs_IP'" />小说总IP
											<else/>{$key}
											</if>:
											<if condition="$key eq 'zh_IP' or $key eq 'IP'"><input data-key="{$key}" onchange="setip(this)" type="txt" value="{$value}" onkeyup="input_keyup(this)" old-value="{$value}" />
											<else/>
											{$value}
											</if></span>
											</volist>
										</td>
										<else />
										<td class="td_c" data-day="{$key}">{$vo_v}</td>
										</if>
										</volist>
									</tr>
									</volist>
									</table>
									</div>
							</div><!-- /.row -->
						</div><!-- /.page-content-area -->
					</div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />
</div><!-- /.main-container -->
<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	function setip(obj){
		var ip=$(obj).val();
		var old_ip=$(obj).attr('old-value');
		if(ip==''){
			$(obj).val(old_ip);
			return false;
		}
		var ip_type=$(obj).attr('data-key');
		var data_day=$(obj).closest('td').attr('data-day');
		var hour=$(obj).closest('tr').find('td').eq(0).html();
		var hour_arr=hour.split(':');
		hour=hour_arr[0];
		var date=$('#day_log_table').find('tr').eq(0).find('td[data-day='+data_day+']').html();
		
		$.ajax({
			url : "{:U('Statistics/setdaylogIP')}",
			type : 'post',
			data : {
				ip:ip,
				ip_type : ip_type,
				hour : hour,
				date : date,
			},
			success : function (data, response, status) {
				
			}
		});
		
	}
	function input_keyup(obj){
		//如果输入非数字，则替换为''，如果输入数字，则在每4位之后添加一个空格分隔
		$(obj).val($(obj).val().replace(/[^\d]/g, ''));
	}

	$(window).scroll(function() {
	  if($(this).scrollTop()>100){
		if($('.col-xs-12').find('#day_log_table_f').length>0){
			$('.col-xs-12').find('#day_log_table_f').css('top',$(this).scrollTop()-102);
			return;
		}
		$('.col-xs-12').css('position','relative');
		$('.col-xs-12').append('<table cellspacing="0" cellpadding="0" id="day_log_table_f"><tr>'+$("#day_log_table").find('tr').eq(0).html()+'</tr></table>');
	  }else{
		$('.col-xs-12').find('#day_log_table_f').remove();
	  }
	});
</script>
</body>
</html>